package com.smedi.ismedi.cronjob.api.infrastructure.cron;

import lombok.Data;

@Data
public class CronExpression {
    private CronType seconds;

    private CronType minutes;

    private CronType hour;

    private CronType day;

    private CronType month;

    private CronType week;

    private CronType year;

    @Override
    public String toString() {
        StringBuffer stringBuffer = new StringBuffer();

        stringBuffer.append(seconds.toString());
        stringBuffer.append(" ");

        stringBuffer.append(minutes.toString());
        stringBuffer.append(" ");

        stringBuffer.append(hour.toString());
        stringBuffer.append(" ");

        stringBuffer.append(day.toString());
        stringBuffer.append(" ");

        stringBuffer.append(month.toString());
        stringBuffer.append(" ");

        stringBuffer.append(week.toString());
        stringBuffer.append(" ");

        stringBuffer.append(year.toString());

        return stringBuffer.toString();
    }
}
